using System;
using System.Collections.Generic;
using System.Text;

using DataAccessLayer;
using System.Data;
using System.Data.SqlClient;

public class RecordingBuilder
{
    public static readonly string recordingTitle = "Recording Title";
    public static readonly DateTime releaseDate = new DateTime(1999, 3, 12);

    private long artistId;
    private long labelId;
    private long recordingId;
    private ArtistGateway artistGateway;
    private LabelGateway labelGateway;
    private RecordingGateway recordingGateway;

    public RecordingDataSet Make(SqlConnection connection)
    {
        RecordingDataSet recordingDataSet = new RecordingDataSet();
        artistGateway = new ArtistGateway(connection);
        artistId = artistGateway.Insert("Test Artist", recordingDataSet);

        labelGateway = new LabelGateway(connection);
        labelId = labelGateway.Insert("Test Label", recordingDataSet);

        recordingGateway = new RecordingGateway(connection);
        recordingId = recordingGateway.Insert(recordingTitle, releaseDate, artistId, labelId, recordingDataSet);
        return recordingDataSet;

    }

    public void Delete(RecordingDataSet recordingDataSet)
    {
        artistGateway.Delete(artistId, recordingDataSet);
        labelGateway.Delete(labelId, recordingDataSet);
        recordingGateway.Delete(recordingId, recordingDataSet);
    }


    public long ArtistId
    {
        get { return artistId; }
    }
    public long LabelId
    {
        get { return labelId; }
    }
    public long RecordingId
    {
        get { return recordingId; }
    }

    public string Title
    {
        get { return recordingTitle; }
    }
    public DateTime ReleaseDate
    {
        get { return releaseDate; }
    }
    public RecordingGateway Gateway
    {
        get { return recordingGateway; }
    }
 
	
}

